<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <js file="__PUBLIC__/Js/jquery-1.7.2.min.js"/>
    <js file="__PUBLIC__/Js/ghulam.js"/>
</head>
<body>
<div class="container-fluid" >
    <div class="row">
        <div class="col-sm-9" style="width: 100%">
            <h3 class="sub-header">添加管理员</h3>
            <div class="table-responsive">
                <form  action="{:U(GROUP_NAME.'/Rbac/addUserHandle')}" id="add-form" method="post" onsubmit="return false">

                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th width="20%">分类</th>
                            <th>参数</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>管理员名称</td>
                            <td>
                                <input type="text" class="form-control text"  name="username" placeholder="管理员名称" />
                            </td>
                        </tr>
                        <tr>
                            <td>管理员真实名称</td>
                            <td>
                                <input type="text" class="form-control text" name="realname" placeholder="真实名称" />
                            </td>
                        </tr>
                        <tr>
                            <td>密码</td>
                            <td>
                                <input type="text" class="form-control text" name="password" placeholder="密码" />
                            </td>
                        </tr>
                        <tr>
                            <td>密码verify</td>
                            <td>
                                <input type="text" class="form-control text" name="password1" placeholder="密码 verify"/>
                            </td>
                        </tr>
                        <tr class="form-group">
                            <td>选择角色</td>
                            <td>
                                <div class="col-sm-offset-2 col-sm-5">
                                    <select name="role_id[]" class="form-control">
                                        <option value="">选择角色</option>
                                        <foreach name="role" item="v">
                                            <option value="{$v['id']}">{$v.name}({$v.remark})</option>
                                        </foreach>
                                    </select>
                                </div>
                                <div class="col-sm-5">
                                    <a class="btn btn-primary" id="role">添加一个角色</a>
                                </div>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                            <td><input type="submit" value="保存"  id="save" class="btn btn-primary"></td>
                        </tr>
                        </tbody>
                    </table>
                </form>
            </div>
        </div>
    </div>
</div>
<link href="__PUBLIC__/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="__PUBLIC__/bootstrap/css/button.css" rel="stylesheet">
<script src="__PUBLIC__/bootstrap/js/jquery-1.9.1.js"></script>
<script src="__PUBLIC__/bootstrap/js/bootstrap.js"></script>
<script>
    $(function()
    {   var a=0;
        $('#role').click(function()
        {   if(a==0){
            var obj = $(this).parents('.form-group').clone();
            obj.find('#role').remove();
            $('.form-group').after(obj);
            a=1;
        }else{

            return;
        }
        })
    });
</script>
</body>
</html>